package bigraph.part.tree;

import java.beans.PropertyChangeEvent;
import java.util.List;

import org.eclipse.gef.EditPolicy;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ISharedImages;

import bigraph.editpolicies.AppDeletePolicy;
import bigraph.model.Node;
import bigraph.model.Canvas;

public class CanvasTreeEditPart extends AppAbstractTreeEditPart {

	protected List<Node> getModelChildren() {
	     return ((Canvas)getModel()).getChildrenArray();
	}

	@Override
	public void propertyChange(PropertyChangeEvent evt) {
	     if(evt.getPropertyName().equals(Node.PROPERTY_ADD)) refreshChildren();
	     if(evt.getPropertyName().equals(Node.PROPERTY_REMOVE)) refreshChildren();
	}

}
